import type { App } from 'vue'
//v-md-editor
import VueMarkdownEditor from '@kangc/v-md-editor';
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';
// import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
// import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import createLineNumbertPlugin from '@kangc/v-md-editor/lib/plugins/line-number/index';
import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index';
import '@kangc/v-md-editor/lib/plugins/copy-code/copy-code.css';

// 引入所有语言包
import hljs from 'highlight.js';
//import Prism from 'prismjs';


VueMarkdownEditor.use(githubTheme, {
  Hljs: hljs
});
VueMarkdownEditor.use(createLineNumbertPlugin());

VMdPreview.use(githubTheme, {
  Hljs: hljs
});
VMdPreview.use(createLineNumbertPlugin());
VMdPreview.use(createCopyCodePlugin());

// VueMarkdownEditor.use(vuepressTheme, {
//   Prism,
// });
// VueMarkdownEditor.use(createLineNumbertPlugin());
// VMdPreview.use(createLineNumbertPlugin());
// VMdPreview.use(vuepressTheme, {
//   Prism,
// });


export function setupMdEditor(app: App) {
  app.use(VueMarkdownEditor)
  app.use(VMdPreview)
}

export default setupMdEditor